package com.itheima.Demo01.demo02;

import java.io.*;

import java.net.InetAddress;
import java.net.ServerSocket;
import java.net.Socket;
import java.util.Scanner;

public class ServerSockeT {
    public static void main(String[] args) throws IOException {
        ServerSocket SS = new ServerSocket(10000);
        Socket accept = SS.accept();
        InputStream stream = accept.getInputStream();
        System.setIn(stream);
        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        InetAddress inetAddress = accept.getInetAddress();
        System.out.println(inetAddress.getHostAddress());
        System.out.println(s);

        PrintWriter pw = new PrintWriter(accept.getOutputStream(), true);
        pw.println("回句");

        accept.close();
        SS.close();

    }
}
